import request from '@/utils/request'
enum API {
  readApi = '/laboratory/recordIntroduce',
  createApi = '/laboratory/recordInsert',
  updateApi = '/laboratory/recordUpdate',
  detailApi = '/laboratory/recordUpdateEcho',
  deleteApi = '/laboratory/recordDelete',
}
/**
 * 战绩查询
 * @returns
 */
export const readApi = () => request.get<any>(API.readApi)

/**
 * 新增战绩
 * @returns
 */
export const createApi = (data: Object) =>
  request.post<any>(API.createApi, data)

/**
 * 修改战绩
 * @returns
 */
export const updateApi = (data: Object) =>
  request.post<any>(API.updateApi, data)

/**
 * 战绩修改回显
 * @returns
 */
export const detailApi = (data: Object) =>
  request.get<any>(API.detailApi, { params: data })

/**
 * 删除战绩
 * @returns
 */
export const deleteApi = (data: Object) =>
  request.post<any>(API.deleteApi + '?id=' + data['id'])
